﻿@model List<LeEdu.MODEL.Estimate>

@{
    Layout = null;
    LeEdu.BLL.BaseBLL<LeEdu.MODEL.Courses> courbll = new LeEdu.BLL.BaseBLL<LeEdu.MODEL.Courses>();
    List<LeEdu.MODEL.Courses> course = courbll.getEntityList(t => true).ToList();

}

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
 <!-- 网页头部分布视图 -->
@Html.Partial("~/Views/Shared/HouTai_Header.cshtml")

<body>

    <script>
    //全选
    function QX(che) {
        if ($('#ch')[0].checked) {

            $('input[name="check"]').prop("checked", true);
        }
        else {
            $('input[name="check"]').prop("checked", false);
        }
    }


    //批量删除
    function PLDelEstimate() {
        var a = "";
        $('input[name="check"]:checked').each(function () {
            a += $(this).val() + ',';
        });

        if ( a == "") {

            alert('选择删除的项！');
            return;
        }
        a = a.substring(0, a.length - 1);
   
        if (confirm('确定删除吗？')) {
            $.post('/Course/PLDelEstimate', { id: a }, function (da) {
                if (da == 1) {
                    alert('删除成功！');
                    location.href = '/Course/Estimate';
                }
                else {
                    alert('删除失败！');
                }
            })
        }
    }
    </script>

    <!-- 网页导航菜单分布视图 -->
    @Html.Partial("~/Views/Shared/HouTai_DaoHang.cshtml")

    <div class="container">
        <div class="row">

            <!-- 网页左侧菜单分布视图 -->
            @Html.Partial("~/Views/Shared/HouTai_Left_Menu_Course.cshtml")


            <div class="col-md-10">
                <div class="page-header clearfix">
                    <h1 class="pull-left">评价管理</h1>
                    <div class="pull-right">

                    </div>
                </div>




                @*<ul class="nav nav-tabs mbm">
                    <li class="active">
                        <a href="/admin/review">课程评价</a>
                    </li>
                    <li>
                        <a href="/admin/classroom/review">班级评价</a>
                    </li>
                </ul>*@

                <form id="review-search-form" class="form-inline well well-sm" action="/Course/Estimate" method="post" >
                    <div class="form-group">
                        <select class="form-control" name="Score">
                            <option value="">评分</option>
                            <option value="1">1星</option>
                            <option value="2">2星</option>
                            <option value="3">3星</option>
                            <option value="4">4星</option>
                            <option value="5">5星</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <select class="form-control" name="CoursesID">
                            <option value="">--课程名--</option>
                            @{
                                foreach (var item in course)
                                {
                                    <option value="@item.CoursesId">@item.CoursesName</option>
                                }
                            }
                        </select>
                    </div>
                    <div class="form-group">
                        <input class="form-control" placeholder="评价内容关键词" name="EstimateContent" value="" type="text">
                    </div>
                    <button class="btn btn-primary" type="submit" name="sousuo">搜索</button>
                </form>
                <div id="review-table-container">
                    <table class="table table-striped table-hover" id="review-table">
                        <thead>
                            <tr>
                                <th >选择</th>
                                <th >评价内容</th>
                                <th >评分</th>
                                <th >作者</th>
                                <th >操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                foreach (var item in Model)
                                {
                                    <tr>
                                        <td><input data-role="batch-select" id="che" name="check" value="@item.ID" type="checkbox"></td>
                                        <td>@item.EstimateContent</td>
                                        <td>
                                            @{

                                    if (item.Score == 1)
                                    { 
                                    @:1星
                                    }
                                    if (item.Score == 2)
                                    {
                                        @:2星
                                    }
                                    if (item.Score == 3)
                                    {
                                        @:3星
                                    }
                                    if (item.Score == 4)
                                    {
                                        @:4星
                                    }
                                    if (item.Score == 5)
                                    {
                                        @:5星
                                    }
                                    
                                    }
                                        </td>
                                        <td>@item.UserInfo.Uname</td>
                                        <td>
                                            <a class="btn btn-default btn-sm" data-role="item-delete" data-name="评价" data-url="/admin/review/4/delete" href="/Course/DelEstimate/@item.ID" onclick="return confirm('您确定要删除吗？')">删除</a>
                                        </td>
                                    </tr>
                                }
                            }
                        </tbody>
                    </table>


                  
                    <a class="btn btn-default" href="/Course/Notes/?PageIndex=1&HourID=@ViewBag.HourID&NoteContent=@ViewBag.NoteContent">首页</a>
                    <a href="/Course/Notes/?PageIndex=@(ViewBag.PageIndex-1)&HourID=@ViewBag.HourID&NoteContent=@ViewBag.NoteContent" class="btn btn-default">上一页</a>
                    @{
                        //显示5个页码
                        //开始页码  （后5个页码  开始页码从倒数第5个开始）
                        int MinIndex = ViewBag.PageIndex;
                        if (MinIndex + 4 > ViewBag.PageCount)
                        {
                            MinIndex = ViewBag.PageCount - 4 < 1 ? 1 : ViewBag.PageCount - 4;
                        }
                        //结束页码要在pageCount范围内
                        int MaxIndex = ViewBag.PageIndex + 4;
                        if (MaxIndex > ViewBag.PageCount)
                        {
                            MaxIndex = ViewBag.PageCount;
                        }
                    }

                    @for (int i = MinIndex; i <= MaxIndex; i++)
                    {
                        <a href="/Course/Notes/?PageIndex=@i&HourID=@ViewBag.HourID& notecontent=@ViewBag.NoteContent" class="btn  @(ViewBag.PageIndex == i ? "btn-primary" : "btn-default")">@i</a>
                    }

                    <a href="/Course/Notes/?PageIndex=@(ViewBag.PageIndex+1)&HourID=@ViewBag.HourID&NoteContent=@ViewBag.NoteContent" class="btn btn-default">下一页</a>
                    <a href="/Course/Notes/?PageIndex=@ViewBag.PageCount  &HourID=@ViewBag.HourID& NoteContent = @ViewBag.NoteContent" class="btn btn-default">尾页</a>
                    <span style="margin-left:50px">每页 <b style="color:#ff0000">@ViewBag.PageSize </b>条/共 <b style="color:#ff0000"> @ViewBag.PageCount</b> 页</span>

                 







                        <div>
                            <label class="checkbox-inline"><input data-role="batch-select" id="ch" onclick="QX()" type="checkbox"> 全选</label>
                            <button class="btn btn-default btn-sm mlm" data-url="/admin/review/batch_delete" data-role="batch-delete" onclick="PLDelEstimate()" data-name="评价">删除</button>
                        </div>
</div>

            </div>
        </div>
    </div>

    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.6';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };

        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';

        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.6" };

        app.arguments = {};
        app.controller = 'review/list';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';

        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.6';
    </script>
    <script src="~/Content/js/sea.js"></script>
    <script src="~/Content/js/seajs-style.js"></script>
    <script src="~/Content/js/seajs-global-config.js"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    <div class="fixed-bar">
        <a href="/admin/feedback" target="_blank" class="icon-question-text feedback">
            <i class="es-icon es-icon-help"></i>
            <span>产品<br>反馈</span>
        </a>
    </div>


</body>
</html>